package cc.aiee.demo.springboot.controller.chinapay.bean;

import cc.aiee.core.abstracts.AbstractQuickModel;
import cc.aiee.core.interfaces.PayJsonBeanInterface;
import cc.aiee.core.kit.KitJson;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@Schema(description = "支付接口")
@EqualsAndHashCode(callSuper = false)
public class ChinaPayPaymentQuery extends AbstractQuickModel implements PayJsonBeanInterface {

	@Schema(description = "版本号:认证支付和快捷支付:20150922,其余:20140728", example = "20140728", required = true)
	private String version = "20140728";

	@Schema(description = "接入类型:0:商户身份,1:机构身份", example = "0", required = true, hidden = true)
	private String accessType = "0";

	@Schema(description = "商户号 ", example = "000092009088965", required = true, hidden = true)
	private String merId;

	@Schema(description = "商户订单号", example = "20200925173336000XXZ", required = true, hidden = true)
	private String merOrderNo;

	@Schema(description = "商户交易日期:格式:YYYYMMDD", example = "20200925", required = true, hidden = true)
	private String tranDate;

	@Schema(description = "商户交易时间:格式: HHMMDD", example = "140921", required = true, hidden = true)
	private String tranTime;

	@Schema(description = "订单金额 :单位:分", example = "1", required = true)
	private String orderAmt;

	@Schema(description = "交易类型 :0001 个人网银支付 0002 企业网银支付 0003 授信交易 0004 快捷支付 0005 下单支付/转账、 ChinaPay 手机控件支付 0006 认证支付 0007 分期付款 0008 后台支付 0009 扫码支付 0101 代收 0201 预授权交易 0000 综合支付 ")
	private String tranType;

	@Schema(description = "业务类型 ", example = "0001", required = true, hidden = true)
	private String busiType = "0001";

	@Schema(description = "交易币种", example = "CNY", required = true)
	private String curryNo = "CNY";

	@Schema(description = "商户后台通知 地址", required = true, hidden = true)
	private String merBgUrl;

	@Schema(description = "防钓鱼客户浏览器 IP", required = true, hidden = true)
	private String remoteAddr;

	@Override
	public <T> T model(T cls) {
		BeanUtil.copyProperties(this, cls, true);
		return cls;
	}

	@Override
	public String toJson() {
		return KitJson.toJSONString(this);
	}

	@Override
	public String toJson(boolean prettyFormat, boolean ignoreNull) {
		return KitJson.toJSONString(this, prettyFormat, ignoreNull);
	}

}
